/************************************************************************/
/* Name : Kiwon Yun
/* Partner's name : Eric Rooney
/* File Name : GameInfo.cpp
/* The name of assignment : Iteration 2
/************************************************************************/

#include "GameInfo.h"
#include "Dealer.h"

GameInfo::GameInfo(void)
{
	m_bStartGame = false;
	m_bEndGame = false;
	m_strWinnerName = NULL;
	m_nRoundNum = 0;
}

GameInfo::~GameInfo(void)
{
	if( m_strWinnerName )
	{
		delete m_strWinnerName;
		m_strWinnerName = NULL;
	}
}

void GameInfo::Init( Dealer* a_pDealer )
{
	m_pDealer = a_pDealer;
}

void GameInfo::SetStartGame( bool a_bStartGame )
{
	m_bStartGame = a_bStartGame;
}

void GameInfo::SetEndGame( bool a_bEndGame )
{
	m_bEndGame = a_bEndGame;
}

bool GameInfo::IsStartGame()
{
	return m_bStartGame;
}

bool GameInfo::IsEndGame()
{
	return m_bEndGame;
}

void GameInfo::SetWinnerName( char* a_strWinnerName )
{
	m_strWinnerName = new char[ strlen( a_strWinnerName ) + 1 ];
	strcpy( m_strWinnerName, a_strWinnerName );
}

char* GameInfo::GetWinnerName()
{
	if( m_bEndGame )
	{
		return m_strWinnerName;
	}
	else
	{
		// for test
		assert(0);
		return NULL;
	}
}

void GameInfo::AddRound()
{
	m_nRoundNum++;
}

int GameInfo::GetRound()
{
	return m_nRoundNum;
}
